package com.lwei.ljpro.action;

import com.lwei.ljpro.entry.WorkingEntry;
import com.lwei.ljpro.service.IWorkingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/admin")
public class AdminAction {

    @RequestMapping("/*")
    public void toHtml(){}

    @Autowired
    private IWorkingService workingService;

    @RequestMapping("/detail")
    public String showDetail(Model model, Long id){

        WorkingEntry workingEntry = workingService.getWorkingEntryById(id);

        model.addAttribute("work", workingEntry);
        return "admin/detail";
    }
}
